import React from 'react'
import ReactDOM from 'react-dom'

const user = {
  firstName: 'tom',
  lastName: 'jerry'
}

function formatName(user) {
  return user.firstName + '-----' + user.lastName
}

const element = (
  <div>
    <h1>hello, { formatName(user) }</h1>
    <h2>你好, { user.firstName }</h2>
  </div>
)

ReactDOM.render(
  element,
  document.getElementById('root')
)